{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "353bd140",
   "metadata": {
    "_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19",
    "_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5",
    "execution": {
     "iopub.execute_input": "2025-06-30T05:57:32.959132Z",
     "iopub.status.busy": "2025-06-30T05:57:32.958871Z",
     "iopub.status.idle": "2025-06-30T05:57:34.539207Z",
     "shell.execute_reply": "2025-06-30T05:57:34.538470Z"
    },
    "papermill": {
     "duration": 1.584839,
     "end_time": "2025-06-30T05:57:34.540566",
     "exception": false,
     "start_time": "2025-06-30T05:57:32.955727",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/kaggle/input/titanic/train.csv\n",
      "/kaggle/input/titanic/test.csv\n",
      "/kaggle/input/titanic/gender_submission.csv\n"
     ]
    }
   ],
   "source": [
    "# This Python 3 environment comes with many helpful analytics libraries installed\n",
    "# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n",
    "# For example, here's several helpful packages to load\n",
    "\n",
    "import numpy as np # linear algebra\n",
    "import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n",
    "\n",
    "# Input data files are available in the read-only \"../input/\" directory\n",
    "# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n",
    "\n",
    "import os\n",
    "for dirname, _, filenames in os.walk('/kaggle/input'):\n",
    "    for filename in filenames:\n",
    "        print(os.path.join(dirname, filename))\n",
    "\n",
    "# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n",
    "# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "1deb2774",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-30T05:57:34.545443Z",
     "iopub.status.busy": "2025-06-30T05:57:34.544777Z",
     "iopub.status.idle": "2025-06-30T05:57:34.594792Z",
     "shell.execute_reply": "2025-06-30T05:57:34.593885Z"
    },
    "papermill": {
     "duration": 0.05395,
     "end_time": "2025-06-30T05:57:34.596480",
     "exception": false,
     "start_time": "2025-06-30T05:57:34.542530",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[nan 'C85' 'C123' 'E46' 'G6' 'C103' 'D56' 'A6' 'C23 C25 C27' 'B78' 'D33'\n",
      " 'B30' 'C52' 'B28' 'C83' 'F33' 'F G73' 'E31' 'A5' 'D10 D12' 'D26' 'C110'\n",
      " 'B58 B60' 'E101' 'F E69' 'D47' 'B86' 'F2' 'C2' 'E33' 'B19' 'A7' 'C49'\n",
      " 'F4' 'A32' 'B4' 'B80' 'A31' 'D36' 'D15' 'C93' 'C78' 'D35' 'C87' 'B77'\n",
      " 'E67' 'B94' 'C125' 'C99' 'C118' 'D7' 'A19' 'B49' 'D' 'C22 C26' 'C106'\n",
      " 'C65' 'E36' 'C54' 'B57 B59 B63 B66' 'C7' 'E34' 'C32' 'B18' 'C124' 'C91'\n",
      " 'E40' 'T' 'C128' 'D37' 'B35' 'E50' 'C82' 'B96 B98' 'E10' 'E44' 'A34'\n",
      " 'C104' 'C111' 'C92' 'E38' 'D21' 'E12' 'E63' 'A14' 'B37' 'C30' 'D20' 'B79'\n",
      " 'E25' 'D46' 'B73' 'C95' 'B38' 'B39' 'B22' 'C86' 'C70' 'A16' 'C101' 'C68'\n",
      " 'A10' 'E68' 'B41' 'A20' 'D19' 'D50' 'D9' 'A23' 'B50' 'A26' 'D48' 'E58'\n",
      " 'C126' 'B71' 'B51 B53 B55' 'D49' 'B5' 'B20' 'F G63' 'C62 C64' 'E24' 'C90'\n",
      " 'C45' 'E8' 'B101' 'D45' 'C46' 'D30' 'E121' 'D11' 'E77' 'F38' 'B3' 'D6'\n",
      " 'B82 B84' 'D17' 'A36' 'B102' 'B69' 'E49' 'C47' 'D28' 'E17' 'A24' 'C50'\n",
      " 'B42' 'C148']\n"
     ]
    }
   ],
   "source": [
    "data_upgrade = pd.read_csv(\"/kaggle/input/titanic/gender_submission.csv\")\n",
    "data_train = pd.read_csv(\"/kaggle/input/titanic/train.csv\")\n",
    "data_test = pd.read_csv(\"/kaggle/input/titanic/test.csv\")\n",
    "print(data_train[\"Cabin\"].unique())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "651c22ac",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-30T05:57:34.600589Z",
     "iopub.status.busy": "2025-06-30T05:57:34.600369Z",
     "iopub.status.idle": "2025-06-30T05:57:34.642299Z",
     "shell.execute_reply": "2025-06-30T05:57:34.641276Z"
    },
    "papermill": {
     "duration": 0.045234,
     "end_time": "2025-06-30T05:57:34.643448",
     "exception": false,
     "start_time": "2025-06-30T05:57:34.598214",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Index(['Survived', 'Age', 'SibSp', 'Fare', 'Sex_female', 'Sex_male',\n",
      "       'Pclass_1', 'Pclass_2', 'Pclass_3', 'Parch_0', 'Parch_1', 'Parch_2',\n",
      "       'Parch_3', 'Parch_4', 'Parch_5', 'Parch_6', 'Embarked_C', 'Embarked_Q',\n",
      "       'Embarked_S', 'Cabin_0', 'Cabin_A', 'Cabin_B', 'Cabin_C', 'Cabin_D',\n",
      "       'Cabin_E', 'Cabin_F', 'Cabin_G', 'Cabin_T'],\n",
      "      dtype='object')\n",
      "Index(['Age', 'SibSp', 'Fare', 'Sex_female', 'Sex_male', 'Pclass_1',\n",
      "       'Pclass_2', 'Pclass_3', 'Parch_0', 'Parch_1', 'Parch_2', 'Parch_3',\n",
      "       'Parch_4', 'Parch_5', 'Parch_6', 'Parch_9', 'Embarked_C', 'Embarked_Q',\n",
      "       'Embarked_S', 'Cabin_0', 'Cabin_A', 'Cabin_B', 'Cabin_C', 'Cabin_D',\n",
      "       'Cabin_E', 'Cabin_F', 'Cabin_G'],\n",
      "      dtype='object')\n",
      "Index(['Age', 'SibSp', 'Fare', 'Sex_female', 'Sex_male', 'Pclass_1',\n",
      "       'Pclass_2', 'Pclass_3', 'Parch_0', 'Parch_1', 'Parch_2', 'Parch_3',\n",
      "       'Parch_4', 'Parch_5', 'Parch_6', 'Embarked_C', 'Embarked_Q',\n",
      "       'Embarked_S', 'Cabin_0', 'Cabin_A', 'Cabin_B', 'Cabin_C', 'Cabin_D',\n",
      "       'Cabin_E', 'Cabin_F', 'Cabin_G', 'Cabin_T'],\n",
      "      dtype='object')\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/tmp/ipykernel_13/2220782806.py:9: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.\n",
      "The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.\n",
      "\n",
      "For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.\n",
      "\n",
      "\n",
      "  df[\"Cabin\"].fillna(\"0\",inplace=True)\n",
      "/tmp/ipykernel_13/2220782806.py:9: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.\n",
      "The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.\n",
      "\n",
      "For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.\n",
      "\n",
      "\n",
      "  df[\"Cabin\"].fillna(\"0\",inplace=True)\n"
     ]
    }
   ],
   "source": [
    "def data_filter(df):\n",
    "    columns = list(df.columns)\n",
    "    if \"PassengerId\" in columns:\n",
    "        columns.remove(\"PassengerId\")\n",
    "    if \"Ticket\" in columns:\n",
    "        columns.remove(\"Ticket\")    \n",
    "    if \"Name\" in columns:\n",
    "        columns.remove(\"Name\")\n",
    "    df[\"Cabin\"].fillna(\"0\",inplace=True)\n",
    "    df[\"Cabin\"] = df[\"Cabin\"].apply(lambda x:x[0])\n",
    "    df = df[columns]\n",
    "    df = df.fillna(df.mode().iloc[0])\n",
    "    cols_to_astype = ['Pclass','Parch',\"Cabin\"]\n",
    "    df[cols_to_astype ] = df[cols_to_astype ].astype('category')\n",
    "    # 选择要转换的列\n",
    "    cols_to_encode = ['Sex','Pclass','Parch','Embarked',\"Cabin\"]\n",
    "    # 使用get_dummies进行one-hot编码\n",
    "    one_hot = pd.get_dummies(df[cols_to_encode])\n",
    "    # 将结果与原数据框合并\n",
    "    df_encoded = pd.concat([df.drop(cols_to_encode, axis=1), one_hot], axis=1)\n",
    "    print(df_encoded.columns)\n",
    "    if 'Survived' in df_encoded.columns:\n",
    "        y = df_encoded['Survived']               # 目标变量\n",
    "        X = df_encoded.drop('Survived', axis=1)  # 特征矩阵\n",
    "        return X,y\n",
    "    else:\n",
    "        return df_encoded\n",
    "train_x,train_y = data_filter(data_train)\n",
    "test_x = data_filter(data_test)\n",
    "test_x = test_x.reindex(columns=train_x.columns, fill_value=False)\n",
    "\n",
    "print(test_x.columns)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ac1761e9",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-30T05:57:34.647488Z",
     "iopub.status.busy": "2025-06-30T05:57:34.647307Z",
     "iopub.status.idle": "2025-06-30T05:57:36.454449Z",
     "shell.execute_reply": "2025-06-30T05:57:36.453823Z"
    },
    "papermill": {
     "duration": 1.810585,
     "end_time": "2025-06-30T05:57:36.455744",
     "exception": false,
     "start_time": "2025-06-30T05:57:34.645159",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[Parallel(n_jobs=1)]: Done   1 tasks      | elapsed:    0.1s\n",
      "[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.1s finished\n"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "model = LogisticRegression(penalty='l2', \n",
    "                           dual=False, \n",
    "                           tol=0.00001, \n",
    "                           C=10, \n",
    "                           fit_intercept=False, \n",
    "                           intercept_scaling=1, \n",
    "                           class_weight=None, \n",
    "                           random_state=None, \n",
    "                           solver='lbfgs', \n",
    "                           max_iter=100000, \n",
    "                           multi_class='auto', \n",
    "                           verbose=10000, \n",
    "                           warm_start=False, \n",
    "                           n_jobs=None, \n",
    "                           l1_ratio=None)\n",
    "model.fit(train_x,train_y)\n",
    "predictions = model.predict(train_x)\n",
    "probabilities = model.predict_proba(train_x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "da0eb993",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-06-30T05:57:36.467056Z",
     "iopub.status.busy": "2025-06-30T05:57:36.466693Z",
     "iopub.status.idle": "2025-06-30T05:57:36.576225Z",
     "shell.execute_reply": "2025-06-30T05:57:36.575621Z"
    },
    "papermill": {
     "duration": 0.116317,
     "end_time": "2025-06-30T05:57:36.579652",
     "exception": false,
     "start_time": "2025-06-30T05:57:36.463335",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(0, PassengerId    892\n",
      "Survived         0\n",
      "Name: 0, dtype: int64)\n",
      "(1, PassengerId    893\n",
      "Survived         0\n",
      "Name: 1, dtype: int64)\n",
      "(2, PassengerId    894\n",
      "Survived         0\n",
      "Name: 2, dtype: int64)\n",
      "(3, PassengerId    895\n",
      "Survived         0\n",
      "Name: 3, dtype: int64)\n",
      "(4, PassengerId    896\n",
      "Survived         1\n",
      "Name: 4, dtype: int64)\n",
      "(5, PassengerId    897\n",
      "Survived         0\n",
      "Name: 5, dtype: int64)\n",
      "(6, PassengerId    898\n",
      "Survived         1\n",
      "Name: 6, dtype: int64)\n",
      "(7, PassengerId    899\n",
      "Survived         0\n",
      "Name: 7, dtype: int64)\n",
      "(8, PassengerId    900\n",
      "Survived         1\n",
      "Name: 8, dtype: int64)\n",
      "(9, PassengerId    901\n",
      "Survived         0\n",
      "Name: 9, dtype: int64)\n",
      "(10, PassengerId    902\n",
      "Survived         0\n",
      "Name: 10, dtype: int64)\n",
      "(11, PassengerId    903\n",
      "Survived         0\n",
      "Name: 11, dtype: int64)\n",
      "(12, PassengerId    904\n",
      "Survived         1\n",
      "Name: 12, dtype: int64)\n",
      "(13, PassengerId    905\n",
      "Survived         0\n",
      "Name: 13, dtype: int64)\n",
      "(14, PassengerId    906\n",
      "Survived         1\n",
      "Name: 14, dtype: int64)\n",
      "(15, PassengerId    907\n",
      "Survived         1\n",
      "Name: 15, dtype: int64)\n",
      "(16, PassengerId    908\n",
      "Survived         0\n",
      "Name: 16, dtype: int64)\n",
      "(17, PassengerId    909\n",
      "Survived         0\n",
      "Name: 17, dtype: int64)\n",
      "(18, PassengerId    910\n",
      "Survived         1\n",
      "Name: 18, dtype: int64)\n",
      "(19, PassengerId    911\n",
      "Survived         1\n",
      "Name: 19, dtype: int64)\n",
      "(20, PassengerId    912\n",
      "Survived         0\n",
      "Name: 20, dtype: int64)\n",
      "(21, PassengerId    913\n",
      "Survived         0\n",
      "Name: 21, dtype: int64)\n",
      "(22, PassengerId    914\n",
      "Survived         1\n",
      "Name: 22, dtype: int64)\n",
      "(23, PassengerId    915\n",
      "Survived         1\n",
      "Name: 23, dtype: int64)\n",
      "(24, PassengerId    916\n",
      "Survived         1\n",
      "Name: 24, dtype: int64)\n",
      "(25, PassengerId    917\n",
      "Survived         0\n",
      "Name: 25, dtype: int64)\n",
      "(26, PassengerId    918\n",
      "Survived         1\n",
      "Name: 26, dtype: int64)\n",
      "(27, PassengerId    919\n",
      "Survived         0\n",
      "Name: 27, dtype: int64)\n",
      "(28, PassengerId    920\n",
      "Survived         0\n",
      "Name: 28, dtype: int64)\n",
      "(29, PassengerId    921\n",
      "Survived         0\n",
      "Name: 29, dtype: int64)\n",
      "(30, PassengerId    922\n",
      "Survived         0\n",
      "Name: 30, dtype: int64)\n",
      "(31, PassengerId    923\n",
      "Survived         0\n",
      "Name: 31, dtype: int64)\n",
      "(32, PassengerId    924\n",
      "Survived         0\n",
      "Name: 32, dtype: int64)\n",
      "(33, PassengerId    925\n",
      "Survived         1\n",
      "Name: 33, dtype: int64)\n",
      "(34, PassengerId    926\n",
      "Survived         0\n",
      "Name: 34, dtype: int64)\n",
      "(35, PassengerId    927\n",
      "Survived         0\n",
      "Name: 35, dtype: int64)\n",
      "(36, PassengerId    928\n",
      "Survived         1\n",
      "Name: 36, dtype: int64)\n",
      "(37, PassengerId    929\n",
      "Survived         1\n",
      "Name: 37, dtype: int64)\n",
      "(38, PassengerId    930\n",
      "Survived         0\n",
      "Name: 38, dtype: int64)\n",
      "(39, PassengerId    931\n",
      "Survived         0\n",
      "Name: 39, dtype: int64)\n",
      "(40, PassengerId    932\n",
      "Survived         0\n",
      "Name: 40, dtype: int64)\n",
      "(41, PassengerId    933\n",
      "Survived         1\n",
      "Name: 41, dtype: int64)\n",
      "(42, PassengerId    934\n",
      "Survived         0\n",
      "Name: 42, dtype: int64)\n",
      "(43, PassengerId    935\n",
      "Survived         1\n",
      "Name: 43, dtype: int64)\n",
      "(44, PassengerId    936\n",
      "Survived         1\n",
      "Name: 44, dtype: int64)\n",
      "(45, PassengerId    937\n",
      "Survived         0\n",
      "Name: 45, dtype: int64)\n",
      "(46, PassengerId    938\n",
      "Survived         0\n",
      "Name: 46, dtype: int64)\n",
      "(47, PassengerId    939\n",
      "Survived         0\n",
      "Name: 47, dtype: int64)\n",
      "(48, PassengerId    940\n",
      "Survived         1\n",
      "Name: 48, dtype: int64)\n",
      "(49, PassengerId    941\n",
      "Survived         0\n",
      "Name: 49, dtype: int64)\n",
      "(50, PassengerId    942\n",
      "Survived         0\n",
      "Name: 50, dtype: int64)\n",
      "(51, PassengerId    943\n",
      "Survived         0\n",
      "Name: 51, dtype: int64)\n",
      "(52, PassengerId    944\n",
      "Survived         1\n",
      "Name: 52, dtype: int64)\n",
      "(53, PassengerId    945\n",
      "Survived         1\n",
      "Name: 53, dtype: int64)\n",
      "(54, PassengerId    946\n",
      "Survived         0\n",
      "Name: 54, dtype: int64)\n",
      "(55, PassengerId    947\n",
      "Survived         0\n",
      "Name: 55, dtype: int64)\n",
      "(56, PassengerId    948\n",
      "Survived         0\n",
      "Name: 56, dtype: int64)\n",
      "(57, PassengerId    949\n",
      "Survived         0\n",
      "Name: 57, dtype: int64)\n",
      "(58, PassengerId    950\n",
      "Survived         0\n",
      "Name: 58, dtype: int64)\n",
      "(59, PassengerId    951\n",
      "Survived         1\n",
      "Name: 59, dtype: int64)\n",
      "(60, PassengerId    952\n",
      "Survived         0\n",
      "Name: 60, dtype: int64)\n",
      "(61, PassengerId    953\n",
      "Survived         0\n",
      "Name: 61, dtype: int64)\n",
      "(62, PassengerId    954\n",
      "Survived         0\n",
      "Name: 62, dtype: int64)\n",
      "(63, PassengerId    955\n",
      "Survived         1\n",
      "Name: 63, dtype: int64)\n",
      "(64, PassengerId    956\n",
      "Survived         1\n",
      "Name: 64, dtype: int64)\n",
      "(65, PassengerId    957\n",
      "Survived         1\n",
      "Name: 65, dtype: int64)\n",
      "(66, PassengerId    958\n",
      "Survived         1\n",
      "Name: 66, dtype: int64)\n",
      "(67, PassengerId    959\n",
      "Survived         0\n",
      "Name: 67, dtype: int64)\n",
      "(68, PassengerId    960\n",
      "Survived         0\n",
      "Name: 68, dtype: int64)\n",
      "(69, PassengerId    961\n",
      "Survived         0\n",
      "Name: 69, dtype: int64)\n",
      "(70, PassengerId    962\n",
      "Survived         1\n",
      "Name: 70, dtype: int64)\n",
      "(71, PassengerId    963\n",
      "Survived         0\n",
      "Name: 71, dtype: int64)\n",
      "(72, PassengerId    964\n",
      "Survived         1\n",
      "Name: 72, dtype: int64)\n",
      "(73, PassengerId    965\n",
      "Survived         1\n",
      "Name: 73, dtype: int64)\n",
      "(74, PassengerId    966\n",
      "Survived         1\n",
      "Name: 74, dtype: int64)\n",
      "(75, PassengerId    967\n",
      "Survived         1\n",
      "Name: 75, dtype: int64)\n",
      "(76, PassengerId    968\n",
      "Survived         0\n",
      "Name: 76, dtype: int64)\n",
      "(77, PassengerId    969\n",
      "Survived         1\n",
      "Name: 77, dtype: int64)\n",
      "(78, PassengerId    970\n",
      "Survived         0\n",
      "Name: 78, dtype: int64)\n",
      "(79, PassengerId    971\n",
      "Survived         1\n",
      "Name: 79, dtype: int64)\n",
      "(80, PassengerId    972\n",
      "Survived         0\n",
      "Name: 80, dtype: int64)\n",
      "(81, PassengerId    973\n",
      "Survived         0\n",
      "Name: 81, dtype: int64)\n",
      "(82, PassengerId    974\n",
      "Survived         0\n",
      "Name: 82, dtype: int64)\n",
      "(83, PassengerId    975\n",
      "Survived         0\n",
      "Name: 83, dtype: int64)\n",
      "(84, PassengerId    976\n",
      "Survived         0\n",
      "Name: 84, dtype: int64)\n",
      "(85, PassengerId    977\n",
      "Survived         0\n",
      "Name: 85, dtype: int64)\n",
      "(86, PassengerId    978\n",
      "Survived         1\n",
      "Name: 86, dtype: int64)\n",
      "(87, PassengerId    979\n",
      "Survived         1\n",
      "Name: 87, dtype: int64)\n",
      "(88, PassengerId    980\n",
      "Survived         1\n",
      "Name: 88, dtype: int64)\n",
      "(89, PassengerId    981\n",
      "Survived         0\n",
      "Name: 89, dtype: int64)\n",
      "(90, PassengerId    982\n",
      "Survived         1\n",
      "Name: 90, dtype: int64)\n",
      "(91, PassengerId    983\n",
      "Survived         0\n",
      "Name: 91, dtype: int64)\n",
      "(92, PassengerId    984\n",
      "Survived         1\n",
      "Name: 92, dtype: int64)\n",
      "(93, PassengerId    985\n",
      "Survived         0\n",
      "Name: 93, dtype: int64)\n",
      "(94, PassengerId    986\n",
      "Survived         0\n",
      "Name: 94, dtype: int64)\n",
      "(95, PassengerId    987\n",
      "Survived         0\n",
      "Name: 95, dtype: int64)\n",
      "(96, PassengerId    988\n",
      "Survived         1\n",
      "Name: 96, dtype: int64)\n",
      "(97, PassengerId    989\n",
      "Survived         0\n",
      "Name: 97, dtype: int64)\n",
      "(98, PassengerId    990\n",
      "Survived         1\n",
      "Name: 98, dtype: int64)\n",
      "(99, PassengerId    991\n",
      "Survived         0\n",
      "Name: 99, dtype: int64)\n",
      "(100, PassengerId    992\n",
      "Survived         1\n",
      "Name: 100, dtype: int64)\n",
      "(101, PassengerId    993\n",
      "Survived         0\n",
      "Name: 101, dtype: int64)\n",
      "(102, PassengerId    994\n",
      "Survived         0\n",
      "Name: 102, dtype: int64)\n",
      "(103, PassengerId    995\n",
      "Survived         0\n",
      "Name: 103, dtype: int64)\n",
      "(104, PassengerId    996\n",
      "Survived         1\n",
      "Name: 104, dtype: int64)\n",
      "(105, PassengerId    997\n",
      "Survived         0\n",
      "Name: 105, dtype: int64)\n",
      "(106, PassengerId    998\n",
      "Survived         0\n",
      "Name: 106, dtype: int64)\n",
      "(107, PassengerId    999\n",
      "Survived         0\n",
      "Name: 107, dtype: int64)\n",
      "(108, PassengerId    1000\n",
      "Survived          0\n",
      "Name: 108, dtype: int64)\n",
      "(109, PassengerId    1001\n",
      "Survived          1\n",
      "Name: 109, dtype: int64)\n",
      "(110, PassengerId    1002\n",
      "Survived          0\n",
      "Name: 110, dtype: int64)\n",
      "(111, PassengerId    1003\n",
      "Survived          1\n",
      "Name: 111, dtype: int64)\n",
      "(112, PassengerId    1004\n",
      "Survived          1\n",
      "Name: 112, dtype: int64)\n",
      "(113, PassengerId    1005\n",
      "Survived          1\n",
      "Name: 113, dtype: int64)\n",
      "(114, PassengerId    1006\n",
      "Survived          1\n",
      "Name: 114, dtype: int64)\n",
      "(115, PassengerId    1007\n",
      "Survived          0\n",
      "Name: 115, dtype: int64)\n",
      "(116, PassengerId    1008\n",
      "Survived          0\n",
      "Name: 116, dtype: int64)\n",
      "(117, PassengerId    1009\n",
      "Survived          1\n",
      "Name: 117, dtype: int64)\n",
      "(118, PassengerId    1010\n",
      "Survived          0\n",
      "Name: 118, dtype: int64)\n",
      "(119, PassengerId    1011\n",
      "Survived          1\n",
      "Name: 119, dtype: int64)\n",
      "(120, PassengerId    1012\n",
      "Survived          1\n",
      "Name: 120, dtype: int64)\n",
      "(121, PassengerId    1013\n",
      "Survived          0\n",
      "Name: 121, dtype: int64)\n",
      "(122, PassengerId    1014\n",
      "Survived          1\n",
      "Name: 122, dtype: int64)\n",
      "(123, PassengerId    1015\n",
      "Survived          0\n",
      "Name: 123, dtype: int64)\n",
      "(124, PassengerId    1016\n",
      "Survived          0\n",
      "Name: 124, dtype: int64)\n",
      "(125, PassengerId    1017\n",
      "Survived          1\n",
      "Name: 125, dtype: int64)\n",
      "(126, PassengerId    1018\n",
      "Survived          0\n",
      "Name: 126, dtype: int64)\n",
      "(127, PassengerId    1019\n",
      "Survived          1\n",
      "Name: 127, dtype: int64)\n",
      "(128, PassengerId    1020\n",
      "Survived          0\n",
      "Name: 128, dtype: int64)\n",
      "(129, PassengerId    1021\n",
      "Survived          0\n",
      "Name: 129, dtype: int64)\n",
      "(130, PassengerId    1022\n",
      "Survived          0\n",
      "Name: 130, dtype: int64)\n",
      "(131, PassengerId    1023\n",
      "Survived          0\n",
      "Name: 131, dtype: int64)\n",
      "(132, PassengerId    1024\n",
      "Survived          0\n",
      "Name: 132, dtype: int64)\n",
      "(133, PassengerId    1025\n",
      "Survived          0\n",
      "Name: 133, dtype: int64)\n",
      "(134, PassengerId    1026\n",
      "Survived          0\n",
      "Name: 134, dtype: int64)\n",
      "(135, PassengerId    1027\n",
      "Survived          0\n",
      "Name: 135, dtype: int64)\n",
      "(136, PassengerId    1028\n",
      "Survived          0\n",
      "Name: 136, dtype: int64)\n",
      "(137, PassengerId    1029\n",
      "Survived          0\n",
      "Name: 137, dtype: int64)\n",
      "(138, PassengerId    1030\n",
      "Survived          1\n",
      "Name: 138, dtype: int64)\n",
      "(139, PassengerId    1031\n",
      "Survived          0\n",
      "Name: 139, dtype: int64)\n",
      "(140, PassengerId    1032\n",
      "Survived          0\n",
      "Name: 140, dtype: int64)\n",
      "(141, PassengerId    1033\n",
      "Survived          1\n",
      "Name: 141, dtype: int64)\n",
      "(142, PassengerId    1034\n",
      "Survived          0\n",
      "Name: 142, dtype: int64)\n",
      "(143, PassengerId    1035\n",
      "Survived          0\n",
      "Name: 143, dtype: int64)\n",
      "(144, PassengerId    1036\n",
      "Survived          0\n",
      "Name: 144, dtype: int64)\n",
      "(145, PassengerId    1037\n",
      "Survived          0\n",
      "Name: 145, dtype: int64)\n",
      "(146, PassengerId    1038\n",
      "Survived          1\n",
      "Name: 146, dtype: int64)\n",
      "(147, PassengerId    1039\n",
      "Survived          0\n",
      "Name: 147, dtype: int64)\n",
      "(148, PassengerId    1040\n",
      "Survived          0\n",
      "Name: 148, dtype: int64)\n",
      "(149, PassengerId    1041\n",
      "Survived          0\n",
      "Name: 149, dtype: int64)\n",
      "(150, PassengerId    1042\n",
      "Survived          1\n",
      "Name: 150, dtype: int64)\n",
      "(151, PassengerId    1043\n",
      "Survived          0\n",
      "Name: 151, dtype: int64)\n",
      "(152, PassengerId    1044\n",
      "Survived          0\n",
      "Name: 152, dtype: int64)\n",
      "(153, PassengerId    1045\n",
      "Survived          0\n",
      "Name: 153, dtype: int64)\n",
      "(154, PassengerId    1046\n",
      "Survived          0\n",
      "Name: 154, dtype: int64)\n",
      "(155, PassengerId    1047\n",
      "Survived          0\n",
      "Name: 155, dtype: int64)\n",
      "(156, PassengerId    1048\n",
      "Survived          1\n",
      "Name: 156, dtype: int64)\n",
      "(157, PassengerId    1049\n",
      "Survived          1\n",
      "Name: 157, dtype: int64)\n",
      "(158, PassengerId    1050\n",
      "Survived          0\n",
      "Name: 158, dtype: int64)\n",
      "(159, PassengerId    1051\n",
      "Survived          1\n",
      "Name: 159, dtype: int64)\n",
      "(160, PassengerId    1052\n",
      "Survived          1\n",
      "Name: 160, dtype: int64)\n",
      "(161, PassengerId    1053\n",
      "Survived          0\n",
      "Name: 161, dtype: int64)\n",
      "(162, PassengerId    1054\n",
      "Survived          1\n",
      "Name: 162, dtype: int64)\n",
      "(163, PassengerId    1055\n",
      "Survived          0\n",
      "Name: 163, dtype: int64)\n",
      "(164, PassengerId    1056\n",
      "Survived          0\n",
      "Name: 164, dtype: int64)\n",
      "(165, PassengerId    1057\n",
      "Survived          1\n",
      "Name: 165, dtype: int64)\n",
      "(166, PassengerId    1058\n",
      "Survived          0\n",
      "Name: 166, dtype: int64)\n",
      "(167, PassengerId    1059\n",
      "Survived          0\n",
      "Name: 167, dtype: int64)\n",
      "(168, PassengerId    1060\n",
      "Survived          1\n",
      "Name: 168, dtype: int64)\n",
      "(169, PassengerId    1061\n",
      "Survived          1\n",
      "Name: 169, dtype: int64)\n",
      "(170, PassengerId    1062\n",
      "Survived          0\n",
      "Name: 170, dtype: int64)\n",
      "(171, PassengerId    1063\n",
      "Survived          0\n",
      "Name: 171, dtype: int64)\n",
      "(172, PassengerId    1064\n",
      "Survived          0\n",
      "Name: 172, dtype: int64)\n",
      "(173, PassengerId    1065\n",
      "Survived          0\n",
      "Name: 173, dtype: int64)\n",
      "(174, PassengerId    1066\n",
      "Survived          0\n",
      "Name: 174, dtype: int64)\n",
      "(175, PassengerId    1067\n",
      "Survived          1\n",
      "Name: 175, dtype: int64)\n",
      "(176, PassengerId    1068\n",
      "Survived          1\n",
      "Name: 176, dtype: int64)\n",
      "(177, PassengerId    1069\n",
      "Survived          0\n",
      "Name: 177, dtype: int64)\n",
      "(178, PassengerId    1070\n",
      "Survived          1\n",
      "Name: 178, dtype: int64)\n",
      "(179, PassengerId    1071\n",
      "Survived          1\n",
      "Name: 179, dtype: int64)\n",
      "(180, PassengerId    1072\n",
      "Survived          0\n",
      "Name: 180, dtype: int64)\n",
      "(181, PassengerId    1073\n",
      "Survived          1\n",
      "Name: 181, dtype: int64)\n",
      "(182, PassengerId    1074\n",
      "Survived          1\n",
      "Name: 182, dtype: int64)\n",
      "(183, PassengerId    1075\n",
      "Survived          0\n",
      "Name: 183, dtype: int64)\n",
      "(184, PassengerId    1076\n",
      "Survived          1\n",
      "Name: 184, dtype: int64)\n",
      "(185, PassengerId    1077\n",
      "Survived          0\n",
      "Name: 185, dtype: int64)\n",
      "(186, PassengerId    1078\n",
      "Survived          1\n",
      "Name: 186, dtype: int64)\n",
      "(187, PassengerId    1079\n",
      "Survived          0\n",
      "Name: 187, dtype: int64)\n",
      "(188, PassengerId    1080\n",
      "Survived          0\n",
      "Name: 188, dtype: int64)\n",
      "(189, PassengerId    1081\n",
      "Survived          0\n",
      "Name: 189, dtype: int64)\n",
      "(190, PassengerId    1082\n",
      "Survived          0\n",
      "Name: 190, dtype: int64)\n",
      "(191, PassengerId    1083\n",
      "Survived          0\n",
      "Name: 191, dtype: int64)\n",
      "(192, PassengerId    1084\n",
      "Survived          0\n",
      "Name: 192, dtype: int64)\n",
      "(193, PassengerId    1085\n",
      "Survived          0\n",
      "Name: 193, dtype: int64)\n",
      "(194, PassengerId    1086\n",
      "Survived          0\n",
      "Name: 194, dtype: int64)\n",
      "(195, PassengerId    1087\n",
      "Survived          0\n",
      "Name: 195, dtype: int64)\n",
      "(196, PassengerId    1088\n",
      "Survived          1\n",
      "Name: 196, dtype: int64)\n",
      "(197, PassengerId    1089\n",
      "Survived          1\n",
      "Name: 197, dtype: int64)\n",
      "(198, PassengerId    1090\n",
      "Survived          0\n",
      "Name: 198, dtype: int64)\n",
      "(199, PassengerId    1091\n",
      "Survived          1\n",
      "Name: 199, dtype: int64)\n",
      "(200, PassengerId    1092\n",
      "Survived          1\n",
      "Name: 200, dtype: int64)\n",
      "(201, PassengerId    1093\n",
      "Survived          0\n",
      "Name: 201, dtype: int64)\n",
      "(202, PassengerId    1094\n",
      "Survived          0\n",
      "Name: 202, dtype: int64)\n",
      "(203, PassengerId    1095\n",
      "Survived          1\n",
      "Name: 203, dtype: int64)\n",
      "(204, PassengerId    1096\n",
      "Survived          0\n",
      "Name: 204, dtype: int64)\n",
      "(205, PassengerId    1097\n",
      "Survived          0\n",
      "Name: 205, dtype: int64)\n",
      "(206, PassengerId    1098\n",
      "Survived          1\n",
      "Name: 206, dtype: int64)\n",
      "(207, PassengerId    1099\n",
      "Survived          0\n",
      "Name: 207, dtype: int64)\n",
      "(208, PassengerId    1100\n",
      "Survived          1\n",
      "Name: 208, dtype: int64)\n",
      "(209, PassengerId    1101\n",
      "Survived          0\n",
      "Name: 209, dtype: int64)\n",
      "(210, PassengerId    1102\n",
      "Survived          0\n",
      "Name: 210, dtype: int64)\n",
      "(211, PassengerId    1103\n",
      "Survived          0\n",
      "Name: 211, dtype: int64)\n",
      "(212, PassengerId    1104\n",
      "Survived          0\n",
      "Name: 212, dtype: int64)\n",
      "(213, PassengerId    1105\n",
      "Survived          0\n",
      "Name: 213, dtype: int64)\n",
      "(214, PassengerId    1106\n",
      "Survived          0\n",
      "Name: 214, dtype: int64)\n",
      "(215, PassengerId    1107\n",
      "Survived          0\n",
      "Name: 215, dtype: int64)\n",
      "(216, PassengerId    1108\n",
      "Survived          1\n",
      "Name: 216, dtype: int64)\n",
      "(217, PassengerId    1109\n",
      "Survived          0\n",
      "Name: 217, dtype: int64)\n",
      "(218, PassengerId    1110\n",
      "Survived          1\n",
      "Name: 218, dtype: int64)\n",
      "(219, PassengerId    1111\n",
      "Survived          0\n",
      "Name: 219, dtype: int64)\n",
      "(220, PassengerId    1112\n",
      "Survived          1\n",
      "Name: 220, dtype: int64)\n",
      "(221, PassengerId    1113\n",
      "Survived          0\n",
      "Name: 221, dtype: int64)\n",
      "(222, PassengerId    1114\n",
      "Survived          1\n",
      "Name: 222, dtype: int64)\n",
      "(223, PassengerId    1115\n",
      "Survived          0\n",
      "Name: 223, dtype: int64)\n",
      "(224, PassengerId    1116\n",
      "Survived          1\n",
      "Name: 224, dtype: int64)\n",
      "(225, PassengerId    1117\n",
      "Survived          1\n",
      "Name: 225, dtype: int64)\n",
      "(226, PassengerId    1118\n",
      "Survived          0\n",
      "Name: 226, dtype: int64)\n",
      "(227, PassengerId    1119\n",
      "Survived          1\n",
      "Name: 227, dtype: int64)\n",
      "(228, PassengerId    1120\n",
      "Survived          0\n",
      "Name: 228, dtype: int64)\n",
      "(229, PassengerId    1121\n",
      "Survived          0\n",
      "Name: 229, dtype: int64)\n",
      "(230, PassengerId    1122\n",
      "Survived          0\n",
      "Name: 230, dtype: int64)\n",
      "(231, PassengerId    1123\n",
      "Survived          1\n",
      "Name: 231, dtype: int64)\n",
      "(232, PassengerId    1124\n",
      "Survived          0\n",
      "Name: 232, dtype: int64)\n",
      "(233, PassengerId    1125\n",
      "Survived          0\n",
      "Name: 233, dtype: int64)\n",
      "(234, PassengerId    1126\n",
      "Survived          0\n",
      "Name: 234, dtype: int64)\n",
      "(235, PassengerId    1127\n",
      "Survived          0\n",
      "Name: 235, dtype: int64)\n",
      "(236, PassengerId    1128\n",
      "Survived          0\n",
      "Name: 236, dtype: int64)\n",
      "(237, PassengerId    1129\n",
      "Survived          0\n",
      "Name: 237, dtype: int64)\n",
      "(238, PassengerId    1130\n",
      "Survived          1\n",
      "Name: 238, dtype: int64)\n",
      "(239, PassengerId    1131\n",
      "Survived          1\n",
      "Name: 239, dtype: int64)\n",
      "(240, PassengerId    1132\n",
      "Survived          1\n",
      "Name: 240, dtype: int64)\n",
      "(241, PassengerId    1133\n",
      "Survived          1\n",
      "Name: 241, dtype: int64)\n",
      "(242, PassengerId    1134\n",
      "Survived          1\n",
      "Name: 242, dtype: int64)\n",
      "(243, PassengerId    1135\n",
      "Survived          0\n",
      "Name: 243, dtype: int64)\n",
      "(244, PassengerId    1136\n",
      "Survived          0\n",
      "Name: 244, dtype: int64)\n",
      "(245, PassengerId    1137\n",
      "Survived          0\n",
      "Name: 245, dtype: int64)\n",
      "(246, PassengerId    1138\n",
      "Survived          1\n",
      "Name: 246, dtype: int64)\n",
      "(247, PassengerId    1139\n",
      "Survived          0\n",
      "Name: 247, dtype: int64)\n",
      "(248, PassengerId    1140\n",
      "Survived          1\n",
      "Name: 248, dtype: int64)\n",
      "(249, PassengerId    1141\n",
      "Survived          1\n",
      "Name: 249, dtype: int64)\n",
      "(250, PassengerId    1142\n",
      "Survived          1\n",
      "Name: 250, dtype: int64)\n",
      "(251, PassengerId    1143\n",
      "Survived          0\n",
      "Name: 251, dtype: int64)\n",
      "(252, PassengerId    1144\n",
      "Survived          0\n",
      "Name: 252, dtype: int64)\n",
      "(253, PassengerId    1145\n",
      "Survived          0\n",
      "Name: 253, dtype: int64)\n",
      "(254, PassengerId    1146\n",
      "Survived          0\n",
      "Name: 254, dtype: int64)\n",
      "(255, PassengerId    1147\n",
      "Survived          0\n",
      "Name: 255, dtype: int64)\n",
      "(256, PassengerId    1148\n",
      "Survived          0\n",
      "Name: 256, dtype: int64)\n",
      "(257, PassengerId    1149\n",
      "Survived          0\n",
      "Name: 257, dtype: int64)\n",
      "(258, PassengerId    1150\n",
      "Survived          1\n",
      "Name: 258, dtype: int64)\n",
      "(259, PassengerId    1151\n",
      "Survived          0\n",
      "Name: 259, dtype: int64)\n",
      "(260, PassengerId    1152\n",
      "Survived          0\n",
      "Name: 260, dtype: int64)\n",
      "(261, PassengerId    1153\n",
      "Survived          0\n",
      "Name: 261, dtype: int64)\n",
      "(262, PassengerId    1154\n",
      "Survived          1\n",
      "Name: 262, dtype: int64)\n",
      "(263, PassengerId    1155\n",
      "Survived          1\n",
      "Name: 263, dtype: int64)\n",
      "(264, PassengerId    1156\n",
      "Survived          0\n",
      "Name: 264, dtype: int64)\n",
      "(265, PassengerId    1157\n",
      "Survived          0\n",
      "Name: 265, dtype: int64)\n",
      "(266, PassengerId    1158\n",
      "Survived          0\n",
      "Name: 266, dtype: int64)\n",
      "(267, PassengerId    1159\n",
      "Survived          0\n",
      "Name: 267, dtype: int64)\n",
      "(268, PassengerId    1160\n",
      "Survived          1\n",
      "Name: 268, dtype: int64)\n",
      "(269, PassengerId    1161\n",
      "Survived          0\n",
      "Name: 269, dtype: int64)\n",
      "(270, PassengerId    1162\n",
      "Survived          0\n",
      "Name: 270, dtype: int64)\n",
      "(271, PassengerId    1163\n",
      "Survived          0\n",
      "Name: 271, dtype: int64)\n",
      "(272, PassengerId    1164\n",
      "Survived          1\n",
      "Name: 272, dtype: int64)\n",
      "(273, PassengerId    1165\n",
      "Survived          1\n",
      "Name: 273, dtype: int64)\n",
      "(274, PassengerId    1166\n",
      "Survived          0\n",
      "Name: 274, dtype: int64)\n",
      "(275, PassengerId    1167\n",
      "Survived          1\n",
      "Name: 275, dtype: int64)\n",
      "(276, PassengerId    1168\n",
      "Survived          0\n",
      "Name: 276, dtype: int64)\n",
      "(277, PassengerId    1169\n",
      "Survived          0\n",
      "Name: 277, dtype: int64)\n",
      "(278, PassengerId    1170\n",
      "Survived          0\n",
      "Name: 278, dtype: int64)\n",
      "(279, PassengerId    1171\n",
      "Survived          0\n",
      "Name: 279, dtype: int64)\n",
      "(280, PassengerId    1172\n",
      "Survived          1\n",
      "Name: 280, dtype: int64)\n",
      "(281, PassengerId    1173\n",
      "Survived          0\n",
      "Name: 281, dtype: int64)\n",
      "(282, PassengerId    1174\n",
      "Survived          1\n",
      "Name: 282, dtype: int64)\n",
      "(283, PassengerId    1175\n",
      "Survived          1\n",
      "Name: 283, dtype: int64)\n",
      "(284, PassengerId    1176\n",
      "Survived          1\n",
      "Name: 284, dtype: int64)\n",
      "(285, PassengerId    1177\n",
      "Survived          0\n",
      "Name: 285, dtype: int64)\n",
      "(286, PassengerId    1178\n",
      "Survived          0\n",
      "Name: 286, dtype: int64)\n",
      "(287, PassengerId    1179\n",
      "Survived          0\n",
      "Name: 287, dtype: int64)\n",
      "(288, PassengerId    1180\n",
      "Survived          0\n",
      "Name: 288, dtype: int64)\n",
      "(289, PassengerId    1181\n",
      "Survived          0\n",
      "Name: 289, dtype: int64)\n",
      "(290, PassengerId    1182\n",
      "Survived          0\n",
      "Name: 290, dtype: int64)\n",
      "(291, PassengerId    1183\n",
      "Survived          1\n",
      "Name: 291, dtype: int64)\n",
      "(292, PassengerId    1184\n",
      "Survived          0\n",
      "Name: 292, dtype: int64)\n",
      "(293, PassengerId    1185\n",
      "Survived          0\n",
      "Name: 293, dtype: int64)\n",
      "(294, PassengerId    1186\n",
      "Survived          0\n",
      "Name: 294, dtype: int64)\n",
      "(295, PassengerId    1187\n",
      "Survived          0\n",
      "Name: 295, dtype: int64)\n",
      "(296, PassengerId    1188\n",
      "Survived          1\n",
      "Name: 296, dtype: int64)\n",
      "(297, PassengerId    1189\n",
      "Survived          0\n",
      "Name: 297, dtype: int64)\n",
      "(298, PassengerId    1190\n",
      "Survived          0\n",
      "Name: 298, dtype: int64)\n",
      "(299, PassengerId    1191\n",
      "Survived          0\n",
      "Name: 299, dtype: int64)\n",
      "(300, PassengerId    1192\n",
      "Survived          0\n",
      "Name: 300, dtype: int64)\n",
      "(301, PassengerId    1193\n",
      "Survived          1\n",
      "Name: 301, dtype: int64)\n",
      "(302, PassengerId    1194\n",
      "Survived          0\n",
      "Name: 302, dtype: int64)\n",
      "(303, PassengerId    1195\n",
      "Survived          0\n",
      "Name: 303, dtype: int64)\n",
      "(304, PassengerId    1196\n",
      "Survived          1\n",
      "Name: 304, dtype: int64)\n",
      "(305, PassengerId    1197\n",
      "Survived          1\n",
      "Name: 305, dtype: int64)\n",
      "(306, PassengerId    1198\n",
      "Survived          0\n",
      "Name: 306, dtype: int64)\n",
      "(307, PassengerId    1199\n",
      "Survived          0\n",
      "Name: 307, dtype: int64)\n",
      "(308, PassengerId    1200\n",
      "Survived          0\n",
      "Name: 308, dtype: int64)\n",
      "(309, PassengerId    1201\n",
      "Survived          0\n",
      "Name: 309, dtype: int64)\n",
      "(310, PassengerId    1202\n",
      "Survived          0\n",
      "Name: 310, dtype: int64)\n",
      "(311, PassengerId    1203\n",
      "Survived          0\n",
      "Name: 311, dtype: int64)\n",
      "(312, PassengerId    1204\n",
      "Survived          0\n",
      "Name: 312, dtype: int64)\n",
      "(313, PassengerId    1205\n",
      "Survived          1\n",
      "Name: 313, dtype: int64)\n",
      "(314, PassengerId    1206\n",
      "Survived          1\n",
      "Name: 314, dtype: int64)\n",
      "(315, PassengerId    1207\n",
      "Survived          1\n",
      "Name: 315, dtype: int64)\n",
      "(316, PassengerId    1208\n",
      "Survived          0\n",
      "Name: 316, dtype: int64)\n",
      "(317, PassengerId    1209\n",
      "Survived          0\n",
      "Name: 317, dtype: int64)\n",
      "(318, PassengerId    1210\n",
      "Survived          0\n",
      "Name: 318, dtype: int64)\n",
      "(319, PassengerId    1211\n",
      "Survived          0\n",
      "Name: 319, dtype: int64)\n",
      "(320, PassengerId    1212\n",
      "Survived          0\n",
      "Name: 320, dtype: int64)\n",
      "(321, PassengerId    1213\n",
      "Survived          0\n",
      "Name: 321, dtype: int64)\n",
      "(322, PassengerId    1214\n",
      "Survived          0\n",
      "Name: 322, dtype: int64)\n",
      "(323, PassengerId    1215\n",
      "Survived          0\n",
      "Name: 323, dtype: int64)\n",
      "(324, PassengerId    1216\n",
      "Survived          1\n",
      "Name: 324, dtype: int64)\n",
      "(325, PassengerId    1217\n",
      "Survived          0\n",
      "Name: 325, dtype: int64)\n",
      "(326, PassengerId    1218\n",
      "Survived          1\n",
      "Name: 326, dtype: int64)\n",
      "(327, PassengerId    1219\n",
      "Survived          0\n",
      "Name: 327, dtype: int64)\n",
      "(328, PassengerId    1220\n",
      "Survived          0\n",
      "Name: 328, dtype: int64)\n",
      "(329, PassengerId    1221\n",
      "Survived          0\n",
      "Name: 329, dtype: int64)\n",
      "(330, PassengerId    1222\n",
      "Survived          1\n",
      "Name: 330, dtype: int64)\n",
      "(331, PassengerId    1223\n",
      "Survived          0\n",
      "Name: 331, dtype: int64)\n",
      "(332, PassengerId    1224\n",
      "Survived          0\n",
      "Name: 332, dtype: int64)\n",
      "(333, PassengerId    1225\n",
      "Survived          1\n",
      "Name: 333, dtype: int64)\n",
      "(334, PassengerId    1226\n",
      "Survived          0\n",
      "Name: 334, dtype: int64)\n",
      "(335, PassengerId    1227\n",
      "Survived          0\n",
      "Name: 335, dtype: int64)\n",
      "(336, PassengerId    1228\n",
      "Survived          0\n",
      "Name: 336, dtype: int64)\n",
      "(337, PassengerId    1229\n",
      "Survived          0\n",
      "Name: 337, dtype: int64)\n",
      "(338, PassengerId    1230\n",
      "Survived          0\n",
      "Name: 338, dtype: int64)\n",
      "(339, PassengerId    1231\n",
      "Survived          0\n",
      "Name: 339, dtype: int64)\n",
      "(340, PassengerId    1232\n",
      "Survived          0\n",
      "Name: 340, dtype: int64)\n",
      "(341, PassengerId    1233\n",
      "Survived          0\n",
      "Name: 341, dtype: int64)\n",
      "(342, PassengerId    1234\n",
      "Survived          0\n",
      "Name: 342, dtype: int64)\n",
      "(343, PassengerId    1235\n",
      "Survived          1\n",
      "Name: 343, dtype: int64)\n",
      "(344, PassengerId    1236\n",
      "Survived          0\n",
      "Name: 344, dtype: int64)\n",
      "(345, PassengerId    1237\n",
      "Survived          1\n",
      "Name: 345, dtype: int64)\n",
      "(346, PassengerId    1238\n",
      "Survived          0\n",
      "Name: 346, dtype: int64)\n",
      "(347, PassengerId    1239\n",
      "Survived          1\n",
      "Name: 347, dtype: int64)\n",
      "(348, PassengerId    1240\n",
      "Survived          0\n",
      "Name: 348, dtype: int64)\n",
      "(349, PassengerId    1241\n",
      "Survived          1\n",
      "Name: 349, dtype: int64)\n",
      "(350, PassengerId    1242\n",
      "Survived          1\n",
      "Name: 350, dtype: int64)\n",
      "(351, PassengerId    1243\n",
      "Survived          0\n",
      "Name: 351, dtype: int64)\n",
      "(352, PassengerId    1244\n",
      "Survived          0\n",
      "Name: 352, dtype: int64)\n",
      "(353, PassengerId    1245\n",
      "Survived          0\n",
      "Name: 353, dtype: int64)\n",
      "(354, PassengerId    1246\n",
      "Survived          1\n",
      "Name: 354, dtype: int64)\n",
      "(355, PassengerId    1247\n",
      "Survived          1\n",
      "Name: 355, dtype: int64)\n",
      "(356, PassengerId    1248\n",
      "Survived          1\n",
      "Name: 356, dtype: int64)\n",
      "(357, PassengerId    1249\n",
      "Survived          0\n",
      "Name: 357, dtype: int64)\n",
      "(358, PassengerId    1250\n",
      "Survived          0\n",
      "Name: 358, dtype: int64)\n",
      "(359, PassengerId    1251\n",
      "Survived          0\n",
      "Name: 359, dtype: int64)\n",
      "(360, PassengerId    1252\n",
      "Survived          0\n",
      "Name: 360, dtype: int64)\n",
      "(361, PassengerId    1253\n",
      "Survived          1\n",
      "Name: 361, dtype: int64)\n",
      "(362, PassengerId    1254\n",
      "Survived          1\n",
      "Name: 362, dtype: int64)\n",
      "(363, PassengerId    1255\n",
      "Survived          0\n",
      "Name: 363, dtype: int64)\n",
      "(364, PassengerId    1256\n",
      "Survived          1\n",
      "Name: 364, dtype: int64)\n",
      "(365, PassengerId    1257\n",
      "Survived          0\n",
      "Name: 365, dtype: int64)\n",
      "(366, PassengerId    1258\n",
      "Survived          0\n",
      "Name: 366, dtype: int64)\n",
      "(367, PassengerId    1259\n",
      "Survived          1\n",
      "Name: 367, dtype: int64)\n",
      "(368, PassengerId    1260\n",
      "Survived          1\n",
      "Name: 368, dtype: int64)\n",
      "(369, PassengerId    1261\n",
      "Survived          0\n",
      "Name: 369, dtype: int64)\n",
      "(370, PassengerId    1262\n",
      "Survived          0\n",
      "Name: 370, dtype: int64)\n",
      "(371, PassengerId    1263\n",
      "Survived          1\n",
      "Name: 371, dtype: int64)\n",
      "(372, PassengerId    1264\n",
      "Survived          0\n",
      "Name: 372, dtype: int64)\n",
      "(373, PassengerId    1265\n",
      "Survived          0\n",
      "Name: 373, dtype: int64)\n",
      "(374, PassengerId    1266\n",
      "Survived          1\n",
      "Name: 374, dtype: int64)\n",
      "(375, PassengerId    1267\n",
      "Survived          1\n",
      "Name: 375, dtype: int64)\n",
      "(376, PassengerId    1268\n",
      "Survived          0\n",
      "Name: 376, dtype: int64)\n",
      "(377, PassengerId    1269\n",
      "Survived          0\n",
      "Name: 377, dtype: int64)\n",
      "(378, PassengerId    1270\n",
      "Survived          0\n",
      "Name: 378, dtype: int64)\n",
      "(379, PassengerId    1271\n",
      "Survived          0\n",
      "Name: 379, dtype: int64)\n",
      "(380, PassengerId    1272\n",
      "Survived          0\n",
      "Name: 380, dtype: int64)\n",
      "(381, PassengerId    1273\n",
      "Survived          0\n",
      "Name: 381, dtype: int64)\n",
      "(382, PassengerId    1274\n",
      "Survived          1\n",
      "Name: 382, dtype: int64)\n",
      "(383, PassengerId    1275\n",
      "Survived          1\n",
      "Name: 383, dtype: int64)\n",
      "(384, PassengerId    1276\n",
      "Survived          0\n",
      "Name: 384, dtype: int64)\n",
      "(385, PassengerId    1277\n",
      "Survived          1\n",
      "Name: 385, dtype: int64)\n",
      "(386, PassengerId    1278\n",
      "Survived          0\n",
      "Name: 386, dtype: int64)\n",
      "(387, PassengerId    1279\n",
      "Survived          0\n",
      "Name: 387, dtype: int64)\n",
      "(388, PassengerId    1280\n",
      "Survived          0\n",
      "Name: 388, dtype: int64)\n",
      "(389, PassengerId    1281\n",
      "Survived          0\n",
      "Name: 389, dtype: int64)\n",
      "(390, PassengerId    1282\n",
      "Survived          1\n",
      "Name: 390, dtype: int64)\n",
      "(391, PassengerId    1283\n",
      "Survived          1\n",
      "Name: 391, dtype: int64)\n",
      "(392, PassengerId    1284\n",
      "Survived          0\n",
      "Name: 392, dtype: int64)\n",
      "(393, PassengerId    1285\n",
      "Survived          0\n",
      "Name: 393, dtype: int64)\n",
      "(394, PassengerId    1286\n",
      "Survived          0\n",
      "Name: 394, dtype: int64)\n",
      "(395, PassengerId    1287\n",
      "Survived          1\n",
      "Name: 395, dtype: int64)\n",
      "(396, PassengerId    1288\n",
      "Survived          0\n",
      "Name: 396, dtype: int64)\n",
      "(397, PassengerId    1289\n",
      "Survived          1\n",
      "Name: 397, dtype: int64)\n",
      "(398, PassengerId    1290\n",
      "Survived          0\n",
      "Name: 398, dtype: int64)\n",
      "(399, PassengerId    1291\n",
      "Survived          0\n",
      "Name: 399, dtype: int64)\n",
      "(400, PassengerId    1292\n",
      "Survived          1\n",
      "Name: 400, dtype: int64)\n",
      "(401, PassengerId    1293\n",
      "Survived          0\n",
      "Name: 401, dtype: int64)\n",
      "(402, PassengerId    1294\n",
      "Survived          1\n",
      "Name: 402, dtype: int64)\n",
      "(403, PassengerId    1295\n",
      "Survived          0\n",
      "Name: 403, dtype: int64)\n",
      "(404, PassengerId    1296\n",
      "Survived          0\n",
      "Name: 404, dtype: int64)\n",
      "(405, PassengerId    1297\n",
      "Survived          1\n",
      "Name: 405, dtype: int64)\n",
      "(406, PassengerId    1298\n",
      "Survived          0\n",
      "Name: 406, dtype: int64)\n",
      "(407, PassengerId    1299\n",
      "Survived          0\n",
      "Name: 407, dtype: int64)\n",
      "(408, PassengerId    1300\n",
      "Survived          1\n",
      "Name: 408, dtype: int64)\n",
      "(409, PassengerId    1301\n",
      "Survived          1\n",
      "Name: 409, dtype: int64)\n",
      "(410, PassengerId    1302\n",
      "Survived          1\n",
      "Name: 410, dtype: int64)\n",
      "(411, PassengerId    1303\n",
      "Survived          1\n",
      "Name: 411, dtype: int64)\n",
      "(412, PassengerId    1304\n",
      "Survived          1\n",
      "Name: 412, dtype: int64)\n",
      "(413, PassengerId    1305\n",
      "Survived          0\n",
      "Name: 413, dtype: int64)\n",
      "(414, PassengerId    1306\n",
      "Survived          1\n",
      "Name: 414, dtype: int64)\n",
      "(415, PassengerId    1307\n",
      "Survived          0\n",
      "Name: 415, dtype: int64)\n",
      "(416, PassengerId    1308\n",
      "Survived          0\n",
      "Name: 416, dtype: int64)\n",
      "(417, PassengerId    1309\n",
      "Survived          0\n",
      "Name: 417, dtype: int64)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.metrics import accuracy_score\n",
    "accuracy = accuracy_score(train_y, predictions)\n",
    "test_x = test_x[list(train_x.columns)]\n",
    "test_y = model.predict(test_x)\n",
    "\n",
    "data_return = pd.DataFrame({\"PassengerId\":data_test[\"PassengerId\"],\n",
    "                            \"Survived\":test_y})\n",
    "data_return.to_csv(\"/kaggle/working/gender_submission.csv\", index=False)\n",
    "for item in data_return.iterrows():\n",
    "    print(item)"
   ]
  }
 ],
 "metadata": {
  "kaggle": {
   "accelerator": "none",
   "dataSources": [
    {
     "databundleVersionId": 26502,
     "sourceId": 3136,
     "sourceType": "competition"
    }
   ],
   "dockerImageVersionId": 31040,
   "isGpuEnabled": false,
   "isInternetEnabled": true,
   "language": "python",
   "sourceType": "notebook"
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.11"
  },
  "papermill": {
   "default_parameters": {},
   "duration": 8.209196,
   "end_time": "2025-06-30T05:57:37.100043",
   "environment_variables": {},
   "exception": null,
   "input_path": "__notebook__.ipynb",
   "output_path": "__notebook__.ipynb",
   "parameters": {},
   "start_time": "2025-06-30T05:57:28.890847",
   "version": "2.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
